home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / init.d / screen-cleanup < prev    next >
Text File  |  2008-06-13  |  918b  |  41 lines

  1. #!/bin/sh
  2. # $Id: init,v 1.3 2004/03/16 01:43:45 zal Exp $
  3. #
  4. # Script to remove stale screen named pipes on bootup.
  5. #
  6.  
  7. ### BEGIN INIT INFO
  8. # Provides:          screen-cleanup
  9. # Required-Start:    $remote_fs
  10. # Required-Stop:     $remote_fs
  11. # Default-Start:     S
  12. # Default-Stop:
  13. # Short-Description: screen sessions cleaning
  14. ### END INIT INFO
  15.  
  16. set -e
  17.  
  18. SCREENDIR=/var/run/screen
  19.  
  20. case "$1" in
  21. start)
  22.     if test -L $SCREENDIR || ! test -d $SCREENDIR; then
  23.         rm -f $SCREENDIR
  24.         mkdir $SCREENDIR
  25.         chown root:utmp $SCREENDIR
  26.     fi
  27.     find $SCREENDIR -type p -print0 | xargs -0r rm -f --
  28. # If the local admin has used dpkg-statoverride to install screen setuid,
  29. # change the permissions of $SCREENDIR accordingly
  30.     if [ `stat -c%a /usr/bin/screen` -ge 4000 ]; then
  31.         chmod 0755 $SCREENDIR
  32.     else
  33.         chmod 0775 $SCREENDIR
  34.     fi
  35.     ;;
  36. stop|restart|reload|force-reload)
  37.     ;;
  38. esac
  39.  
  40. exit 0
  41.